$(function () {
  $.ajax({
    url: "/cart/getgoods"
  }).done(function (res) {
    let strHtml = '';
    res.data.forEach(function (item, index) {
      strHtml += `
      <div class="fl-products-item">
      <a href="./details.html?id=${item.id}">
        <div class="img-box">
          <img
            data-original="${item.img}"
            alt=""
          />
        </div>
        <div class="product-content">
          <p class="product-title">${item.title}</p>
          <p class="product-price">
            <span class="price-sign">&yen;</span>
            <span class="price-num">${item.price}</span>
          </p>
          <p class="product-sell">${item.squantity}</p>
        </div>
      </a>
    </div>
        
        `;
    })

    $(".fl_products").html(strHtml);
    $("img").lazyload({ effect: "fadeIn" });
  })
})